package com.tangly.codeing.dao;

import com.tangly.codeing.model.SysPrivilege;
import com.tangly.codeing.model.vo.SysPrivilegeVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import com.tangly.codeing.utils.PageInfo;

import java.util.List;
import java.util.Set;

/**
 * 权限表
 * @author tangbing
 * @date 2019-05-11
 */
@Component
public interface SysPrivilegeDao {

    /**
    * 新增
    */
    void insert(SysPrivilege sysPrivilege);

    /**
    * 删除
    */
    int delete(@Param("id") Long id);

    /**
     * 批量删除
     */
    int batchDelete(@Param("ids") List<String> ids);

    /**
    * 更新
    */
    int update(SysPrivilege sysPrivilege);

    /**
    * Load查询
    */
    SysPrivilege load(@Param("id") Long id);

    /**
    * 分页查询Data
    */
	List<SysPrivilege> pageList(PageInfo pageInfo);

    /**
    * 分页查询Count
    */
    int pageListCount(PageInfo pageInfo);

    List<SysPrivilege> findAll();

    Set<String> findPrivilegeIdByRoleId(String roleId);

    List<SysPrivilegeVo> findDownById(String id);

    List<SysPrivilegeVo> findAllRoot();

    List<SysPrivilege> findByRoleIds(List<Long> roleIds);
}
